package com.zhyl.demo.mapper;

import com.zhyl.demo.entity.User;
import org.apache.ibatis.annotations.Mapper;

import java.util.ArrayList;

@Mapper
public interface UserMapper {
    User login(String username, String password);

    Integer register(User user);

    User selectByUsername(String username);

    /**
     * 获取所有管理员用户
     * @return
     */
    ArrayList<User> getAdminUser();

    /**
     * 上传头像
     * @param user
     * @return
     */
    Integer uploadInfo(User user);

    Integer deleteUser(int userId);

    /**
     * 获取账户信息
     * @param userId
     * @return
     */
    User getUserInfo(Integer userId);

    int updateUser(User user);
}
